﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LookAt : MonoBehaviour {

	public Transform target;
	private void Awake() {
		if(target==null){
		target=Camera.main.transform;

		}
	}
	private void Update() {
		if(target==null) return;
		Vector3 lookPos=target.position;
		lookPos.y=transform.position.y;
		transform.LookAt(lookPos);	
	}
}
